#include <iostream>
#include <string>
#include "../cpp-httplib/httplib.h"


const std::string path = "../wwwroot";

int main()
{
    httplib::Server svr;
    svr.set_base_dir(path.c_str());

    svr.Get("/search", [](const httplib::Request& req, httplib::Response& rsp) {
        if (!req.has_param("wd"))
        {
            rsp.set_content("请输入关键词", "text/plain; charset=utf-8");
        }
        // std::string query = req.get_param_value("wd");
        else 
            rsp.set_content("hello world", "text/plain");

    });

    svr.listen("0.0.0.0", 8080);
    return 0;
}